<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Backup and Restore</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<p>This format is used by extensions for Mozilla Firefox (among others) and consists of a contents.rdf, .properties and .dtd file for each language in the extension.</p>
<p>To access the resource bundles from an extension, first add a <a href="https://developer.mozilla.org/En/XUL/Stringbundle">stringbundle tag</a> to the XUL page on which the JavaScript file is included, then obtain a DOM reference to it and call <em>getString</em>. For example:</p>
<p><strong>myextension.xul</strong></p>
<pre>
&lt;stringbundleset id="stringbundleset"&gt;
&nbsp; &nbsp; &lt;stringbundle id="<span style="color:#EF0E0E;">my-bundle</span>" src="chrome://<span style="color:purple;">myextension</span>/locale/<span style="color:purple;">myextension</span>.properties"/&gt;
&lt;/stringbundleset&gt;
</pre>

<p><strong>myextension.js</strong></p>
<pre>
var bundle = document.getElementById(&#39;<span style="color:#EF0E0E;">my-bundle</span>&#39;);
alert(bundle.getString(&#39;<span style="color:#158F00;">myelement</span>&#39;));
</pre>
<p>Elements in the XUL bundle can be accessed as XML entities. Eg:</p>
<pre>
&lt;menuitem label="&amp;<span style="color:#158F00;">myelement</span>;"&gt;
</pre>

<h2>See Also</h2>
<ul>
<li><a href="https://developer.mozilla.org/en/Building_an_Extension">Mozilla MDC - Building an Extension</a></li>
<li><a href="https://developer.mozilla.org/En/Localizing_an_extension">Mozilla MDC - Localizing an Extension</a></li>
</ul>
</body>
</html>